package com.sy.controller;

import com.sy.dto.JsonResult;
import com.sy.entity.Theme;
import com.sy.service.CartoonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("themes")
public class ThemeController {

    @Autowired
    private CartoonService service;

    /**
     * 漫画的所有题材
     */
    @RequestMapping(method = RequestMethod.GET)
    public JsonResult getAllTheme(){
        List<Theme> allTheme = service.getAllTheme();
        JsonResult result = new JsonResult();
        result.setCode(200);
        result.setData(allTheme);
        return result;
    }
}
